package gewu.suleju.dao.iml;

import gewu.suleju.model.pojo.UserDetail;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;


public interface IUserDetailDao extends JpaRepository<UserDetail,Integer> {
   UserDetail  findUserDetailByUserId(Integer userId)  ;//根据用户的id查询用户详情

   @Transactional
   @Modifying
   @Query(value="update user_detail set sex= ?1 ,birthday=?2 ,hometown=?3 ,profession=?4,tag=?5,person_describe=?6,company=?7 where user_id =?8",nativeQuery = true)
   void updateUserDetail(String sex,String birthday , String hometown, String profession, String tag, String person_describe, String company, Integer user_id);


}
